<template>
    <div>
        <Table border :columns="investment_table.columns" :data="list"></Table>
        <Modal ref="modal" title="Common Modal dialog box title" >
            <p slot="header" style="color:#f60;text-align:center">
                <Icon type="information-circled"></Icon>
                <span>信息审核</span>
            </p>
            <div style="text-align:center">
                <Row>
                    <Col span="6">项目名称：</Col>
                    <Col span="18">{{investment_table.current.title}}</Col>
                </Row>
                <Row>
                    <Col span="6">创建时间：</Col>
                    <Col span="18">{{investment_table.current.formated_create_time}}</Col>
                </Row>
                <Row>
                    <Col span="6">资金类型：</Col>
                    <Col span="18">{{investment_table.current.capital_type}}</Col>
                </Row>
                <Row>
                    <Col span="6">地区：</Col>
                    <Col span="18">{{investment_table.current.area}}</Col>
                </Row>
                <Row>
                    <Col span="6">投资行业：</Col>
                    <Col span="18">{{investment_table.current.investment_industry}}</Col>
                </Row>
                <Row>
                    <Col span="6">投资地区：</Col>
                    <Col span="18">{{investment_table.current.investment_area}}</Col>
                </Row>
            </div>
            <div slot="footer">
                <Row>
					<Col span="12">
						<Radio type="button">审核通过</Radio>
					</Col>
					<Col span="12">
						<Radio type="button">不通过</Radio>
					</Col>
				</Row>
                <Button type="error" size="large" long :loading="modal_loading" @click="ok">审核完毕</Button>
            </div>
        </Modal>
        <AutoPage v-model="page"></AutoPage>
    </div>
</template>
<script>
import Page from "@/common/model/Page";
import AutoPage from "@/common/components/AutoPage";
import Investment from "@/common/model/Investment";
export default {
  data() {
    //变量声明
    return {
      page: new Page("check/investment_list"), //分页查询接口
      investment_table: {
        columns: [
          { title: "ID", key: "id" },
          { title: "名称", key: "title" },
          { title: "时间", key: "formated_create_time" },
          {
            title: "操作",
            key: "action",
            width: "150",
            align: "center",
            render: (h, params) => {
              return h("div", [
                h("Button",
                  {
                    props: { type: "primary", size: "small" },
                    style: { marginRight: "5px" },
                    on: {
                      click: () => {this.check(params.index);}
                    } 
                  },  "审核")
              ]);
            }
          }
        ],
        current: {}
      },
      show_table:{
          columns:[
              {title:"项目名称",key:"value"}
          ]
      }
    };
  },
  computed: {
    list() {
      return Investment.parseList(this.page.list);
    },
  },
  components: {
    AutoPage
  },
  methods: {
    check(index) {
        var investment = new Investment();
        this.investment_table.current = this.list[index];
        this.show();
    },
    ok() {
      this.$Message.info("项目审核完毕！");
      this.$refs["modal"].visible = false;
    },
    show(){
        this.$refs["modal"].visible = true;
    },
  }
};
</script>